package org.polyforms.repository.executor.support;

import javax.inject.Named;
import javax.persistence.Query;

/**
 * Implementation of method which updates or removes entities.
 * 
 * @author Kuisong Tong
 * @since 1.0
 */
@Named
public final class UpdateExecutor extends QueryExecutor {
    /**
     * {@inheritDoc}
     */
    @Override
    protected Object getResult(final Query query) {
        return query.executeUpdate();
    }

    /**
     * {@inheritDoc}
     */
    public String[] getPrefixes() {
        return new String[] { "update", "remove", "delete" };
    }
}
